package com.example.demo;
import com.example.demo.security.dao.AdminRoleDao;
import com.example.demo.security.service.AdminGroupRoleService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringSecurityApplication.class)
public class Text {

    @Autowired
    private AdminGroupRoleService adminGroupRoleService;
    @Resource
    private AdminRoleDao adminRoleDao;


//    @Test
//    public void testSelect() {
//        String username = "admin" ;
//        System.out.println(username);
//        AdminUser adminUser = adminUserService.adminUserName(username);
//        System.out.println(adminUser);
//    }

    @Test
    public void testSelect() {
//        int GroupId = 1 ;
//        List<AdminGroupRole> adminGroupRoles = adminGroupRoleService.selectAdminGroupRole(GroupId);
//        List<String> adminRoles = adminRoleDao.selectByAdminRole(adminGroupRoles);
////        for (String s: adminRoles) {
////            System.out.println(s);
////        }
//        System.out.println(adminRoles);

        PasswordEncoder pe = new BCryptPasswordEncoder();
        String password = pe.encode("123456");
        System.out.println(password);
    }


}
